<template>
  <div id="admin-app">
    <!-- 管理员后台布局 -->
    <admin-layout>
      <router-view />
    </admin-layout>
  </div>
</template>

<script>
import AdminLayout from './components/AdminLayout.vue'

export default {
  name: 'AdminApp',
  components: {
    AdminLayout
  }
}
</script>

<style>
/* 后台管理系统全局样式 */
body.admin-body {
  background-color: #f0f2f5;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#admin-app {
  height: 100vh;
  width: 100%;
}

/* 重置后台管理样式，避免和前台冲突 */
.admin-container {
  width: 100%;
  height: 100%;
  display: flex;
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  background-color: #f0f2f5;
}

/* 后台按钮样式 */
.admin-btn {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  border: none;
  background-color: #f0f0f0;
}

.admin-btn-primary {
  background-color: #1890ff;
  color: white;
}

.admin-btn-primary:hover {
  background-color: #40a9ff;
}

.admin-btn-danger {
  background-color: #ff4d4f;
  color: white;
}

.admin-btn-danger:hover {
  background-color: #ff7875;
}

.admin-btn-success {
  background-color: #52c41a;
  color: white;
}

.admin-btn-success:hover {
  background-color: #73d13d;
}

/* 后台表格样式 */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
  background-color: #fafafa;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
}

.admin-table tr:hover {
  background-color: #f5f5f5;
}

/* 后台表单样式 */
.admin-form {
  background-color: white;
  padding: 24px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-form-item {
  margin-bottom: 24px;
}

.admin-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
}

.admin-form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  transition: all 0.3s;
}

.admin-form-input:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  outline: none;
}

.admin-form-error {
  color: #ff4d4f;
  margin-top: 4px;
  font-size: 14px;
}

/* 后台卡片样式 */
.admin-card {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.admin-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-card-body {
  padding: 24px;
}

/* 后台标签样式 */
.admin-tag {
  display: inline-block;
  padding: 0 7px;
  height: 22px;
  line-height: 22px;
  font-size: 12px;
  border-radius: 2px;
  margin-right: 8px;
}

.admin-tag-green {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}

.admin-tag-blue {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #1890ff;
}

.admin-tag-orange {
  background-color: #fff7e6;
  border: 1px solid #ffd591;
  color: #fa8c16;
}

.admin-tag-red {
  background-color: #fff1f0;
  border: 1px solid #ffa39e;
  color: #ff4d4f;
}

/* 后台警告、成功等提示样式 */
.admin-alert {
  padding: 8px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.admin-alert-success {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
}

.admin-alert-warning {
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
  color: #faad14;
}

.admin-alert-error {
  background-color: #fff1f0;
  border: 1px solid #ffa39e;
  color: #ff4d4f;
}

.admin-alert-info {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #1890ff;
}

/* 工具栏通用样式 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
  background-color: white;
  padding: 16px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 分页器通用样式 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 16px;
  background-color: white;
  padding: 16px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
</style> 